package gov.pbc.nn.uflo.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Lob;
import javax.persistence.Table;

import org.hibernate.annotations.Index;

import com.bstek.dorado.annotation.PropertyDef;

import gov.pbc.nn.core.entity.BaseEntity;

/**
 * 审核意见表
 * 
 * @author louis
 * 
 */
@Entity(name = "gov.pbc.nn.uflo.entity.Opinion")
@Table(name = "T_UFLO_OPINION")
public class Opinion extends BaseEntity {

	private static final long serialVersionUID = 1L;

	@PropertyDef(label = "业务表ID值")
	@Column(name = "BUS_KEY_", length = 60, nullable = false)
	@Index(name = "INDEX_BUS_KEY_")
	private String busKey;

	@PropertyDef(label = "业务表表名称")
	@Column(name = "BUS_TABLE_", length = 60, nullable = false)
	private String busTable;

	@PropertyDef(label = "任务ID", description = "任务ID")
	@Column(name = "TASK_ID_")
	@Index(name = "INDEX_TASK_ID_")
	private Long taskId;
	@PropertyDef(label = "流程实例ID", description = "taskId所在流程的流程实例ID（不一定是顶层流程）")
	@Column(name = "PROCESS_INSTANCE_ID_")
	@Index(name = "INDEX_PROCESS_INSTANCE_ID_")
	private Long processInstanceId;

	@PropertyDef(label = "审批意见", description = "审批意见")
	@Column(name = "OPINION_", length = 1024)
	private String opinion;

	@PropertyDef(label = "审批意见图片", description = "审批意见图片")
	@Lob
	@Column(name = "OPINION_IMG_")
	private byte[] opinionImg;

	@PropertyDef(label = "审核人")
	@Column(name = "USERNAME_")
	@Index(name = "INDEX_USERNAME_")
	private String username;

	@PropertyDef(label = "审核人姓名")
	@Column(name = "CNAME_")
	private String cname;

	@PropertyDef(label = "流程名称")
	@Column(name = "PROCESS_NAME_")
	private String processName;

	@PropertyDef(label = "任务名称")
	@Column(name = "TASK_NAME_")
	private String taskName;

	@PropertyDef(label = "节点名称")
	@Column(name = "NODE_NAME_")
	private String nodeName;

	@PropertyDef(label = "部门id")
	@Column(name = "DEPT_ID_")
	private String deptId;

	@PropertyDef(label = "部门名称")
	@Column(name = "DEPT_NAME_")
	private String deptName;

	public String getCname() {
		return cname;
	}

	public void setCname(String cname) {
		this.cname = cname;
	}

	public String getProcessName() {
		return processName;
	}

	public void setProcessName(String processName) {
		this.processName = processName;
	}

	public String getTaskName() {
		return taskName;
	}

	public void setTaskName(String taskName) {
		this.taskName = taskName;
	}

	public String getDeptId() {
		return deptId;
	}

	public void setDeptId(String deptId) {
		this.deptId = deptId;
	}

	public String getDeptName() {
		return deptName;
	}

	public void setDeptName(String deptName) {
		this.deptName = deptName;
	}

	public String getBusKey() {
		return busKey;
	}

	public void setBusKey(String busKey) {
		this.busKey = busKey;
	}

	public String getBusTable() {
		return busTable;
	}

	public void setBusTable(String busTable) {
		this.busTable = busTable;
	}

	public String getOpinion() {
		return opinion;
	}

	public void setOpinion(String opinion) {
		this.opinion = opinion;
	}

	public byte[] getOpinionImg() {
		return opinionImg;
	}

	public void setOpinionImg(byte[] opinionImg) {
		this.opinionImg = opinionImg;
	}

	public Long getTaskId() {
		return taskId;
	}

	public void setTaskId(Long taskId) {
		this.taskId = taskId;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public Long getProcessInstanceId() {
		return processInstanceId;
	}

	/**
	 * 设置流程实例ID，该流程实例ID是taskId所在流程实例的ID，如果该taskId是一个子流程的任务ID，
	 * 则此处的流程实例ID就是这个子流程实例的ID。
	 * 
	 * @param processInstanceId
	 */
	public void setProcessInstanceId(Long processInstanceId) {
		this.processInstanceId = processInstanceId;
	}

	public String getNodeName() {
		return nodeName;
	}

	public void setNodeName(String nodeName) {
		this.nodeName = nodeName;
	}

}
